<%-- 
    Document   : recherche
    Created on : 3 févr. 2014, 15:58:44
    Author     : albran
--%>

<%@page import="java.io.*"%>
<%@page import="com.nanterre.annuaire.model.CritereRecherche"%>
<%@page import="com.nanterre.annuaire.model.TypeElement"%>
<%@page import="com.nanterre.annuaire.model.Domaine"%>
<%@page import="java.util.*"%>
<%@page import="com.nanterre.annuaire.bd.*"%>
<%@page import="com.nanterre.annuaire.model.ElementAnnuaire"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<!DOCTYPE html>
<!-- This site was created in Webflow. http://www.webflow.com-->
<!-- Last Published: Mon Feb 03 2014 13:58:13 GMT+0000 (UTC) -->
<html data-wf-site="52e66a3c8eadd70134000952">
    <head>
        <meta charset="utf-8">
        <title>Annuaire - recherche</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="text/css" href="css/normalize.css">
        <link rel="stylesheet" type="text/css" href="css/webflow.css">
        <link rel="stylesheet" type="text/css" href="css/momola.css">
        <link rel="stylesheet" type="text/css" href="css/tooltipster.css" />
        <link href="css/bootstrap.css" rel="stylesheet" >
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
        <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
        <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js"></script>
        <script type="text/javascript" src="js/jquery.tooltipster.min.js"></script>
        <script src="js/script.js"></script>
        <script>
            WebFont.load({
                google: {
                    families: ["Montserrat:400,700","Bitter:400,700"]
                }
            });
            
        </script>
        <script>
            if (/mobile/i.test(navigator.userAgent)) document.documentElement.className += ' w-mobile';
        </script>

        
        <link rel="shortcut icon" type="image/x-icon" href="https://www.u-paris10.fr/images/logo.png">
        <!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.min.js"></script><![endif]-->
        <link rel="apple-touch-icon" href="https://y7v4p6k4.ssl.hwcdn.net/51d1bb05fc804b2621000001/51e06f0756878bb26a000008_webclip-slate.png">
    </head>
    <body>
        <%@ include file="header.html"%>
        <div class="w-clearfix" id="page-nav-organize">
            <div class="w-container">
                <div class="w-form">
                    <form action="RechercheAction.do" class="form" name="email-form" data-name="Email Form" method="post">
                        <label for="name">Elément :</label>
                        <select id="critereSelectionne" class="w-select liste_choix" name="critereSelectionne" onchange="modifierListCriteres();">
                            <%
                                int i = 0;
                                TypeElement[] types = TypeElement.values();
                                int valuesNumber = types.length;
                                for (TypeElement type : types) {
                                    String selected = "";
                                    if (i == valuesNumber - 2) {
                                        break;
                                    }
                                    if(type.getLabel().equals("DIPLOME")){
                                        selected = "selected";
                                    }
                            %>
                            <option value="<%=type.getLabel()%>" <%=selected%> ><%=type.getLabel()%></option>
                            <%
                                }
                            %>
                        </select>
                        <label for="name">Chercher par :</label>
                        <select id="critereRecherche" class="w-select liste_choix" name="critereRecherche">
                            <%
                                CritereRecherche[] criteres = CritereRecherche.values();
                                for (CritereRecherche critere : criteres) {
                            %>
                            <option value="<%=critere.getLabel()%>"><%=critere.getLabel()%></option>
                            <%
                                }
                            %>
                        </select>

                        <label for="name">mot à rechercher :</label>
                        <input class="w-input zone-text" type="text" placeholder="votre recherche..." id="recherche" name="recherche" data-name="Name" onkeyup="autoCompletion();" />
                        <input class="w-button" type="submit" value="rechercher" data-wait="Please wait..." onclick="resultatRecherche(); return false;" />
                        <input id="exporter" class="w-button" type="button" value="Exporter la recherche" data-wait="Please wait..." onclick="download(); return false;" />
                        <div id="msgResultatExport"></div>
                        <img id="loading"  src="http://www.ajaxload.info/images/exemples/5.gif" alt="Loading" style="display:none;"/>
                          
                    </form>
                 
                      
                    <a href="#" id="changeAffichage" class="domaine" onclick="changeAffichage();return false;">Afficher par Composantes</a>
                    <div id="msgResultatRecherche"></div>
                    <ul id="debutArbre" class="listArbre">
                        <%
                            if (request.getAttribute("recherche") == null) {
                                BDInteraction bdi = new BDInteraction();
                                List<Domaine> listDomaines = bdi.getAllDomaines();

                                for (Domaine current : listDomaines) {
                        %>
                        <li id="DOMAINE<%=current.getId()%>" class="fermer">
                            <a href="#" class="arbre" onclick="deroulerElement('<%=current.getId()%>', '<%=current.getType().getLabel()%>', '-1');return false;">
                                <span class="test"> 
                                    <img class="derouler" src="images/derouler.jpg" alt="dérouler les informations" /> <%=current.getLibelleComplet()%> 
                                </span>
                            </a>
                        </li>
                        <%

                                }
                            }
                        %>
                    </ul>
                    <div class="w-form-done">
                        <p>Thank you! Your submission has been received!</p>
                    </div>
                    <div class="w-form-fail">
                        <p>Oops! Something went wrong while submitting the form :(</p>
                    </div>
                </div>
            </div>
        </div>
        <%@ include file="footer.html"%>
        <div class="section subfooter white"></div>
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        <script type="text/javascript" src="js/webflow.js"></script>
        <script src="js/bootstrap.js"></script>
    </body>
</html>